3.1.2 \(\int x^2 \cosh (a+b x^2) \, dx\) [2]

Optimal. Leaf size=69 \[ \frac {e^{-a} \sqrt {\pi } \text {Erf}\left (\sqrt {b} x\right )}{8 b^{3/2}}-\frac {e^a \sqrt {\pi } \text {Erfi}\left (\sqrt {b} x\right )}{8 b^{3/2}}+\frac {x \sinh \left (a+b x^2\right )}{2 b} \]

[Out]

1/2*x*sinh(b*x^2+a)/b+1/8*erf(x*b^(1/2))*Pi^(1/2)/b^(3/2)/exp(a)-1/8*exp(a)*erfi(x*b^(1/2))*Pi^(1/2)/b^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5433, 5406, 2235, 2236} \begin {gather*} \frac {\sqrt {\pi } e^{-a} \text {Erf}\left (\sqrt {b} x\right )}{8 b^{3/2}}-\frac {\sqrt {\pi } e^a \text {Erfi}\left (\sqrt {b} x\right )}{8 b^{3/2}}+\frac {x \sinh \left (a+b x^2\right )}{2 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*Cosh[a + b*x^2],x]

[Out]

(Sqrt[Pi]*Erf[Sqrt[b]*x])/(8*b^(3/2)*E^a) - (E^a*Sqrt[Pi]*Erfi[Sqrt[b]*x])/(8*b^(3/2)) + (x*Sinh[a + b*x^2])/(
2*b)

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 5406

Int[Sinh[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Dist[1/2, Int[E^(c + d*x^n), x], x] - Dist[1/2, Int[E^(-c - d*
x^n), x], x] /; FreeQ[{c, d}, x] && IGtQ[n, 1]

Rule 5433

Int[Cosh[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[e^(n - 1)*(e*x)^(m - n + 1)*(Sinh[c +
d*x^n]/(d*n)), x] - Dist[e^n*((m - n + 1)/(d*n)), Int[(e*x)^(m - n)*Sinh[c + d*x^n], x], x] /; FreeQ[{c, d, e}
, x] && IGtQ[n, 0] && LtQ[0, n, m + 1]

Rubi steps

\begin {align*} \int x^2 \cosh \left (a+b x^2\right ) \, dx &=\frac {x \sinh \left (a+b x^2\right )}{2 b}-\frac {\int \sinh \left (a+b x^2\right ) \, dx}{2 b}\\ &=\frac {x \sinh \left (a+b x^2\right )}{2 b}+\frac {\int e^{-a-b x^2} \, dx}{4 b}-\frac {\int e^{a+b x^2} \, dx}{4 b}\\ &=\frac {e^{-a} \sqrt {\pi } \text {erf}\left (\sqrt {b} x\right )}{8 b^{3/2}}-\frac {e^a \sqrt {\pi } \text {erfi}\left (\sqrt {b} x\right )}{8 b^{3/2}}+\frac {x \sinh \left (a+b x^2\right )}{2 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 67, normalized size = 0.97 \begin {gather*} \frac {\sqrt {\pi } \text {Erf}\left (\sqrt {b} x\right ) (\cosh (a)-\sinh (a))-\sqrt {\pi } \text {Erfi}\left (\sqrt {b} x\right ) (\cosh (a)+\sinh (a))+4 \sqrt {b} x \sinh \left (a+b x^2\right )}{8 b^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*Cosh[a + b*x^2],x]

[Out]

(Sqrt[Pi]*Erf[Sqrt[b]*x]*(Cosh[a] - Sinh[a]) - Sqrt[Pi]*Erfi[Sqrt[b]*x]*(Cosh[a] + Sinh[a]) + 4*Sqrt[b]*x*Sinh
[a + b*x^2])/(8*b^(3/2))

________________________________________________________________________________________

Maple [A]
time = 0.50, size = 74, normalized size = 1.07

method result size
risch \(-\frac {{\mathrm e}^{-a} x \,{\mathrm e}^{-x^{2} b}}{4 b}+\frac {{\mathrm e}^{-a} \sqrt {\pi }\, \erf \left (x \sqrt {b}\right )}{8 b^{\frac {3}{2}}}+\frac {{\mathrm e}^{a} {\mathrm e}^{x^{2} b} x}{4 b}-\frac {{\mathrm e}^{a} \sqrt {\pi }\, \erf \left (\sqrt {-b}\, x \right )}{8 b \sqrt {-b}}\) \(74\)
meijerg \(-\frac {i \cosh \left (a \right ) \sqrt {\pi }\, \sqrt {2}\, \left (\frac {x \sqrt {2}\, \left (i b \right )^{\frac {3}{2}} {\mathrm e}^{x^{2} b}}{4 \sqrt {\pi }\, b}-\frac {x \sqrt {2}\, \left (i b \right )^{\frac {3}{2}} {\mathrm e}^{-x^{2} b}}{4 \sqrt {\pi }\, b}+\frac {\left (i b \right )^{\frac {3}{2}} \sqrt {2}\, \erf \left (x \sqrt {b}\right )}{8 b^{\frac {3}{2}}}-\frac {\left (i b \right )^{\frac {3}{2}} \sqrt {2}\, \erfi \left (x \sqrt {b}\right )}{8 b^{\frac {3}{2}}}\right )}{2 b \sqrt {i b}}-\frac {\sinh \left (a \right ) \sqrt {\pi }\, \sqrt {2}\, \left (\frac {x \sqrt {2}\, \left (i b \right )^{\frac {5}{2}} {\mathrm e}^{-x^{2} b}}{4 \sqrt {\pi }\, b^{2}}+\frac {x \sqrt {2}\, \left (i b \right )^{\frac {5}{2}} {\mathrm e}^{x^{2} b}}{4 \sqrt {\pi }\, b^{2}}-\frac {\left (i b \right )^{\frac {5}{2}} \sqrt {2}\, \erf \left (x \sqrt {b}\right )}{8 b^{\frac {5}{2}}}-\frac {\left (i b \right )^{\frac {5}{2}} \sqrt {2}\, \erfi \left (x \sqrt {b}\right )}{8 b^{\frac {5}{2}}}\right )}{2 b \sqrt {i b}}\) \(221\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

-1/4*exp(-a)/b*x*exp(-x^2*b)+1/8*exp(-a)/b^(3/2)*Pi^(1/2)*erf(x*b^(1/2))+1/4*exp(a)*exp(x^2*b)*x/b-1/8*exp(a)/
b*Pi^(1/2)/(-b)^(1/2)*erf((-b)^(1/2)*x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 110 vs. \(2 (49) = 98\).
time = 0.27, size = 110, normalized size = 1.59 \begin {gather*} \frac {1}{3} \, x^{3} \cosh \left (b x^{2} + a\right ) - \frac {1}{24} \, b {\left (\frac {2 \, {\left (2 \, b x^{3} e^{a} - 3 \, x e^{a}\right )} e^{\left (b x^{2}\right )}}{b^{2}} + \frac {2 \, {\left (2 \, b x^{3} + 3 \, x\right )} e^{\left (-b x^{2} - a\right )}}{b^{2}} - \frac {3 \, \sqrt {\pi } \operatorname {erf}\left (\sqrt {b} x\right ) e^{\left (-a\right )}}{b^{\frac {5}{2}}} + \frac {3 \, \sqrt {\pi } \operatorname {erf}\left (\sqrt {-b} x\right ) e^{a}}{\sqrt {-b} b^{2}}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(b*x^2+a),x, algorithm="maxima")

[Out]

1/3*x^3*cosh(b*x^2 + a) - 1/24*b*(2*(2*b*x^3*e^a - 3*x*e^a)*e^(b*x^2)/b^2 + 2*(2*b*x^3 + 3*x)*e^(-b*x^2 - a)/b
^2 - 3*sqrt(pi)*erf(sqrt(b)*x)*e^(-a)/b^(5/2) + 3*sqrt(pi)*erf(sqrt(-b)*x)*e^a/(sqrt(-b)*b^2))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 189 vs. \(2 (49) = 98\).
time = 0.38, size = 189, normalized size = 2.74 \begin {gather*} \frac {2 \, b x \cosh \left (b x^{2} + a\right )^{2} + 4 \, b x \cosh \left (b x^{2} + a\right ) \sinh \left (b x^{2} + a\right ) + 2 \, b x \sinh \left (b x^{2} + a\right )^{2} + \sqrt {\pi } {\left (\cosh \left (b x^{2} + a\right ) \cosh \left (a\right ) + {\left (\cosh \left (a\right ) + \sinh \left (a\right )\right )} \sinh \left (b x^{2} + a\right ) + \cosh \left (b x^{2} + a\right ) \sinh \left (a\right )\right )} \sqrt {-b} \operatorname {erf}\left (\sqrt {-b} x\right ) + \sqrt {\pi } {\left (\cosh \left (b x^{2} + a\right ) \cosh \left (a\right ) + {\left (\cosh \left (a\right ) - \sinh \left (a\right )\right )} \sinh \left (b x^{2} + a\right ) - \cosh \left (b x^{2} + a\right ) \sinh \left (a\right )\right )} \sqrt {b} \operatorname {erf}\left (\sqrt {b} x\right ) - 2 \, b x}{8 \, {\left (b^{2} \cosh \left (b x^{2} + a\right ) + b^{2} \sinh \left (b x^{2} + a\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(b*x^2+a),x, algorithm="fricas")

[Out]

1/8*(2*b*x*cosh(b*x^2 + a)^2 + 4*b*x*cosh(b*x^2 + a)*sinh(b*x^2 + a) + 2*b*x*sinh(b*x^2 + a)^2 + sqrt(pi)*(cos
h(b*x^2 + a)*cosh(a) + (cosh(a) + sinh(a))*sinh(b*x^2 + a) + cosh(b*x^2 + a)*sinh(a))*sqrt(-b)*erf(sqrt(-b)*x)
 + sqrt(pi)*(cosh(b*x^2 + a)*cosh(a) + (cosh(a) - sinh(a))*sinh(b*x^2 + a) - cosh(b*x^2 + a)*sinh(a))*sqrt(b)*
erf(sqrt(b)*x) - 2*b*x)/(b^2*cosh(b*x^2 + a) + b^2*sinh(b*x^2 + a))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} \cosh {\left (a + b x^{2} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cosh(b*x**2+a),x)

[Out]

Integral(x**2*cosh(a + b*x**2), x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 75, normalized size = 1.09 \begin {gather*} \frac {x e^{\left (b x^{2} + a\right )}}{4 \, b} - \frac {x e^{\left (-b x^{2} - a\right )}}{4 \, b} - \frac {\sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x\right ) e^{\left (-a\right )}}{8 \, b^{\frac {3}{2}}} + \frac {\sqrt {\pi } \operatorname {erf}\left (-\sqrt {-b} x\right ) e^{a}}{8 \, \sqrt {-b} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(b*x^2+a),x, algorithm="giac")

[Out]

1/4*x*e^(b*x^2 + a)/b - 1/4*x*e^(-b*x^2 - a)/b - 1/8*sqrt(pi)*erf(-sqrt(b)*x)*e^(-a)/b^(3/2) + 1/8*sqrt(pi)*er
f(-sqrt(-b)*x)*e^a/(sqrt(-b)*b)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^2\,\mathrm {cosh}\left (b\,x^2+a\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh(a + b*x^2),x)

[Out]

int(x^2*cosh(a + b*x^2), x)

________________________________________________________________________________________